<template>

	<view class="coupon mt30 r10" @click="emit('click',data)">
		<view class="content t-flex between r10">
			<view class="title t-flex center" v-if="data.coupon_type==0">
				{{+data.minus_price}} <text class="f26 util">元</text>
			</view>
			<view class="title t-flex center" v-else>
				{{data.discount}}<text class="f26 util">折</text>
			</view>
			<view class="right pl30">
				<view class="f30 c3 bold">
					{{data.coupon_name}}
				</view>
				<view class="f24 c9 mt10">
					{{+data.full_price?`满${+data.full_price}元可用` :'无使用门槛'}}
				</view>
			</view>
		</view>
		<view class="msg f24 pt20 pb20">
			<text v-if="data.tm_type_status==1">
				{{$time(data.begintime,2)}} 至 {{$time(data.endtime,2)}}
			</text>
			<text v-else>
				<text v-if="+data.day">
					有效期至{{data.effective_time_text}}
				</text>
				<text v-else>
					永久有效
				</text>
			</text>
		</view>
		
	</view>
</template>

<script setup>
import { computed } from 'vue';
	
	const emit = defineEmits(['click'])
	
	let props =  defineProps({
		data:{
			type:Object,
			default:{}
		}
	})
	
	
	
	
	
</script>

<style scoped lang="scss">
	.coupon{
		background-color: #FFF5F3;
	}
	.content{
		width: 100%;
		background: #FFFFFF;
		border: 2rpx solid #F0F0F0;
		padding: 36rpx 32rpx;
		.title{
			color: #FF1818;
			width: 25%;
			font-size: 56rpx;
			border-right: 2px dashed #e6e6e6;
		}
		.right{
			width: 75%;
		}
	}
	.msg{
		padding-left: 32rpx;
		color: #FD553A;
	}

</style>